package ch.netcetera.planningpoker.client.ui.main;

import com.google.gwt.event.shared.GwtEvent.Type;
import com.google.inject.Inject;
import com.google.web.bindery.event.shared.EventBus;
import com.gwtplatform.mvp.client.Presenter;
import com.gwtplatform.mvp.client.View;
import com.gwtplatform.mvp.client.annotations.ContentSlot;
import com.gwtplatform.mvp.client.annotations.ProxyStandard;
import com.gwtplatform.mvp.client.proxy.Proxy;
import com.gwtplatform.mvp.client.proxy.RevealContentHandler;
import com.gwtplatform.mvp.client.proxy.RevealRootContentEvent;

public class MainPagePresenter extends Presenter<MainPagePresenter.IView, MainPagePresenter.IProxy> {
    /**
     * Child presenters can fire a RevealContentEvent with MainContentSlot to set themselves
     * as children of this presenter.
     */
    @ContentSlot
    public static final Type<RevealContentHandler<?>> MainContentSlot = new Type<RevealContentHandler<?>>();

    public interface IView extends View {}
      
    @ProxyStandard
    public interface IProxy extends Proxy<MainPagePresenter> {}
      
    @Inject
    public MainPagePresenter(final EventBus eventBus, final IView view, final IProxy proxy) {
      super(eventBus, view, proxy);
    }

    @Override
    protected void revealInParent() {
      RevealRootContentEvent.fire(this, this);
    }
  }
